package com.ibm.datamodel.exp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class ShortSchema {
	
	String[] tagNames;
	HashMap<String, Integer> name2index;
	
	public ShortSchema() {
	}
	
	public ShortSchema(int[] die){
		tagNames = new String[die.length];
		name2index = new HashMap<>();
		for (int i = 0; i < die.length; i++) {
			tagNames[i] = "tag_" + i;
			name2index.put(tagNames[i], i);
		}
	}

	
	public Object getvalue(ObjectMessage message,String tagName){
		int index = name2index.get(tagName);
		return message.getValues()[index];
	}
	
}
